<?php
/*
Galaxy
Author:McFog
*/
define('IN GALAXY', true);
require './include/init.php';

if($g->galx_username) $g->showmessage('login_succeed');

$form = new model_form;
$form->fields['username'] = new model_formfield('username');
$form->fields['password'] = new model_formfield('password', 'password');
$form->fields['loginbyuid'] = new model_formfield('loginmode', 'radio', 'uid');
$form->fields['loginbyusn'] = new model_formfield('loginmode', 'radio', 'usn');
//the value should be defined in shell
$form->fields['submit'] = new model_formfield('dosubmit', 'submit');

//at last compute the formhash
$form->fields['formhash'] = new model_formfield('formhash', 'hidden', $form->formhash);

if($_POST['dosubmit']) {
	$form->checkFormhash();
}

$g->showtemplate("login.htm", array('form'=>$form));
?>